#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <String.au3>

CloseWindows("Wow", WinList("Wow"))
CloseWindows("WowError", WinList("WowError"))
CloseWindows("World of Warcraft Retail", WinList("World of Warcraft Retail"))
CloseWindows("Wow", WinList("Wow"))
CloseWindows("WowError", WinList("WowError"))
CloseWindows("World of Warcraft Retail", WinList("World of Warcraft Retail"))

# CloseARelogErrorWindows()

#$wins = WinList("ARelog")
#If $wins[0][0] == 0 And ProcessExists("ARelog.exe") Then
#   ProcessClose("ARelog.exe")
#EndIf

Func CloseWindows($fullTitle, $windows)
   For $i = 1 to $windows[0][0]
	  If $windows[$i][0] == $fullTitle Then
		 $process = WinGetProcess($windows[$i][1])
		 ProcessClose($process)
	  EndIf
   Next
EndFunc

Func CloseARelogErrorWindows()
   $pid = ProcessList("ARelog.exe")
   If $pid[0][0] > 0 Then
	  $pid = $pid[1][1]
	  $wins = WinList()
	  For $i = 1 To $wins[0][0]
		 $h = $wins[$i][1]
		 If WinGetProcess($h) == $pid	Then
			If WinGetTitle($h) == "" Then
			   $pos = WinGetPos($h)
			   If $pos[0] > 0 And $pos[1] > 0 Then
				  WinClose($h)
			   EndIf
			EndIf
		 EndIf
	  Next
   EndIf
EndFunc

Func RestartAllBots()

EndFunc

Func Test()
EndFunc